import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

import helper.Proxy;
import base.AppMemory;
import controller.Actions;
import controller.Controller;
import controller.ControllerException;

/**
 * TestGui für unsere Wetterstation
 * @author Michel Metzger, Java-Kurs 2013
 * @version 1.0.0
 *
 */
public class TestGuiRun {

	/**
	 * @param args
	 */
	public static void main(String[] args) {

		if (!AppMemory.loadConfig()) {
			System.exit(0);
		}
		Proxy.setProxy();
		setWindowsLookAndFeel();

		Controller controller = new Controller();
		try {
			controller.addView( new TestGui(controller) );
			controller.actionPerformed(Actions.GET_COUNTRIES);
		} catch (ControllerException e) {
			e.printStackTrace();
		}
	}

	public static void setWindowsLookAndFeel() {
		try {
			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e1) {
			// Im Fehlerfall wird nichts getan, d.h. das eingestellte L&F bleibt unverändert
		}
	}

}
